<template>
  <div class="userCenter">
    <el-tabs type="border-card">
      <el-tab-pane label="个人资料">
        <el-form ref="form" :model="form" label-width="80px">
          <el-form-item label="用户名">
            <el-input v-model="form.username"></el-input>
          </el-form-item>
          <el-form-item label="密码">
            <el-input v-model="form.password" type="password"></el-input>
          </el-form-item>
          <el-form-item label="目标院校">
            <el-input v-model="form.tschool"></el-input>
          </el-form-item>
          <el-form-item label="邮箱">
            <el-input v-model="form.email"></el-input>
          </el-form-item>
          <el-form-item label="QQ号码">
            <el-input v-model="form.qq"></el-input>
          </el-form-item>
          <el-form-item label="手机号">
            <el-input v-model="form.telphone"></el-input>
          </el-form-item>
          <el-radio-group v-model="form.sex">
            <el-radio label="男"></el-radio>
            <el-radio label="女"></el-radio>
          </el-radio-group>
          <el-button type="primary" @click="onSubmit">提交</el-button>
        </el-form>
      </el-tab-pane>
      <el-tab-pane label="我的上传">
        <File></File>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>
import { userCenterInfo } from "../api/myReq";
import File from "../components/File.vue";
export default {
  name: "UserCenter",
  data() {
    return {
      form: {},
    };
  },
  components: {
    File,
  },
  methods: {
    onSubmit() {
      userCenterInfo(this.form).then((resp) => {
        this.$message({
          message: resp.data.message,
          duration: 2000,
          type: "success",
        });
      });
    },
  },
  mounted() {
    this.form = this.$store.state.user;
  },
};
</script>

<style scoped>
.el-radio-group{
  display: block;
}
</style>